package com.example.demo.Controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.UnsupportedEncodingException;

@RefreshScope
@RestController
public class TestController {

    @Value("${remoteGitProviderOne}")
    private String remoteGitProviderOne;

    @CrossOrigin
    @RequestMapping("/test")
    public String test(){

        String getRemoteData = "";
        try {
            Thread.sleep(2000);
            getRemoteData = new String(remoteGitProviderOne.getBytes("iso-8859-1"),"UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(getRemoteData);
        return getRemoteData;
    }

    @CrossOrigin
    @RequestMapping("/snowslide")
    public String snowslide(){
        return "测试雪崩效应";
    }
}





























